Page({
  /**
   * 页面的初始数据
   */
  data: {
    avatarUrl:
      "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0",
    userName: "微信用户",
  },
  handleEditUser() {
    wx.navigateTo({
      url: "/pages/improveInformation/index",
    });
  },
  handleJump() {
    wx.navigateTo({
      url: "/pages/visitorInformation/index",
    });
  },
  JumpToFeedBack() {
    wx.navigateTo({
      url: "/pages/feedback/index",
    });
  },
  JumpToAboutUs() {
    wx.navigateTo({
      url: "/pages/about-us/index",
    });
  },
  JumpToGuide() {
    wx.navigateTo({
      url: "/pages/guide/index",
    });
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad() {},
  handleSetLogin({ detail }: any) {
    this.setData({
      isLogin: detail,
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    const avatarUrl =
      wx.getStorageSync("avatarUrl") ||
      "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0";
    const userName = wx.getStorageSync("userName") || "微信用户";
    this.setData({
      avatarUrl,
      userName,
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {},
});
